import matplotlib.pyplot as plt
import numpy as np
import seaborn as sns
# x = np.arange(5)
# y1,y2= np.random.randint(1,25,size=(2,5))
# width = 0.25
# ax = plt.subplot(1,1,1)
# ax.bar(x,y1,width,color="r")
# ax.bar(x+width,y2,width,color="g")
# ax.set_xticks(x+width)
# ax.set_xticklabels(["a","b","c","d","e"])
# plt.show()
# x = np.arange(50)
# # y = x + 5 * np.random.rand(50)
# # plt.scatter(x, y)
# # plt.show()
# x = np.arange(5)
# y1, y2 = np.random.randint(1, 25, size=(2, 5))
# width = 0.25
# ax = plt.subplot(1,1,1)
# ax.bar(x, y1, width, color='r')
# ax.bar(x+width, y2, width, color='g')
# ax.set_xticks(x+width)
# ax.set_xticklabels(['a', 'b', 'c', 'd', 'e'])
# plt.show()
# m = np.random.rand(10,10)
# print(m)
# plt.imshow(m, interpolation='nearest', cmap=plt.cm.ocean)
# plt.colorbar()
# plt.show()
# fig, subplot_arr = plt.subplots(2,2)
# # bins 为显示个数，一般小于等于数值个数
# subplot_arr[1,0].hist(np.random.randn(100), bins=10, color='b', alpha=0.3)
# plt.show()

# x1 = np.random.normal(size=1000)
# sns.distplot(x1)
# #x2 = np.random.randint(0, 100, 500)
# #sns.distplot(x2)
# plt.show()

from bokeh.layouts import gridplot
from bokeh.plotting import figure, output_file, show

# prepare some data
N = 100
x = np.linspace(0, 4*np.pi, N)
y0 = np.sin(x)
y1 = np.cos(x)
y2 = np.sin(x) + np.cos(x)

# output to static HTML file
output_file("linked_panning.html")

# create a new plot
s1 = figure(width=250, plot_height=250, title=None)
s1.circle(x, y0, size=10, color="navy", alpha=0.5)

# NEW: create a new plot and share both ranges
s2 = figure(width=250, height=250, x_range=s1.x_range, y_range=s1.y_range, title=None)
s2.triangle(x, y1, size=10, color="firebrick", alpha=0.5)

# NEW: create a new plot and share only one range
s3 = figure(width=250, height=250, x_range=s1.x_range, title=None)
s3.square(x, y2, size=10, color="olive", alpha=0.5)

# NEW: put the subplots in a gridplot
p = gridplot([[s1, s2, s3]], toolbar_location=None)

# show the results
show(p)